﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Final.Mappings {
    public class SymbolChangeMap : EntityTypeConfiguration<SymbolChange> {
        public SymbolChangeMap() {
            /******************************************************************
            /* Table
            /*****************************************************************/
            ToTable("fin.eod_symbol_changes");

            /******************************************************************
            /* Primary Key
            /*****************************************************************/
            HasKey(c => c.SymbolChangeId);

            /******************************************************************
            /* Index
            /*****************************************************************/
            // None

            /******************************************************************
            /* Relationships
            /*****************************************************************/
            // to do

            /******************************************************************
            /* Properties
            /*****************************************************************/
            Property(c => c.OldSymbolId)
                .IsRequired()
                .HasColumnName("syc_sym_id_old");

            Property(c => c.NewSymbolId)
                .IsRequired()
                .HasColumnName("syc_sym_id_new");

            Property(c => c.OldExchangeId)
                .IsRequired()
                .HasColumnName("syc_exc_id_old");

            Property(c => c.NewExchangeId)
                .IsRequired()
                .HasColumnName("syc_exc_id_new");

            Property(c => c.ChangeDate)
                .IsRequired()
                .HasColumnType("date")
                .HasColumnName("syc_change_dt");
        }
    }
}
